1. Technical Field
The present invention relates to image processing for converting image data represented by an M-ary (M≧3) gradation value into N-arized (M>N≧2) image data, and, in particular to an image processing apparatus, an image processing program, and an image processing method that are suitable for reducing deterioration in an image quality caused by error diffusion processing, and a printing apparatus, a printing apparatus control program, a printing apparatus control method, a print data generating apparatus, a print data generating program, a print data generating method, a display apparatus, a display apparatus control program, and a display apparatus control method to which an image processing technique of any one of the image processing apparatus, the image processing program, and the image processing method is applied.
2. Related Art
In the past, a threshold method was used as a method of converting image data represented by an M-ary (M≧3) gradation value into N-ary (M>N≧2) image data with a certain threshold value as a boundary. In this threshold method, each pixel value of N-ary image data and a predetermined threshold value are compared and the pixel value is converted into any one of N kinds of values depending on whether the pixel value is equal to or larger than the threshold value or smaller than the threshold value. However, in the threshold value, since a difference between the pixel value and a value after conversion is discarded, N-ary image data without information equivalent to the discarded value is generated. As a result, depending on an image, deterioration of an image quality is noticeable. For example, most parts of the image lose gradations.
In the past, to solve the problem of the threshold value, a technique called an error diffusing method of, in N-arizing an M-ary image data, rather than discarding a difference between a pixel value and a value after conversion as in the threshold value, diffusing the difference to plural unprocessed pixels as an error and utilizing the difference was devised. By using this error diffusing method, information that is completely lost in the past is diffused in peripheral pixels and remains. Thus, it is possible to improve image quality after n-arization compared with the threshold value in the past. However, for example, in an error diffusing method of the Floyd & Steinberg type in the past, pixels are subjected to binarization processing in order for each row or each column and an error that has occurred in the binarization processing is diffused to unprocessed pixels in the same direction in all the pixels. Thus, a diffusion range of the error becomes unique and deterioration in an image quality is conspicuous, in particular, in an image in which a gradation changes stepwise such as a gradation image.
Therefore, as a technique for solving the problem in the error diffusing method of performing error diffusion in a regular direction such as the Floyd & Steinberg type, there is an image processing apparatus described in JP-A-9-135351.
This image processing apparatus has an object of creating, in image processing using the error diffusing method, a pseudo halftone image with the occurrence of an eyesore pattern controlled. The image processing apparatus divides a halftone image into plural areas consisting of n image lines and, in each of the areas, sequentially performs binarization processing tracing adjacent pixels in a zigzag shape in such a manner as to traverse the n image lines from a top of the image lines to an end of the image lines. Consequently, unlike the error diffusing method in the past, even if regular binarization processing is performed, the processing is divided for each of the areas. Thus, continuity of a pattern is lost in boundary parts of the areas and the eyesore and regular pattern become less conspicuous.
However, in the image processing apparatus described in JP-A-9-135351, a moving direction of processed pixels is simply switched for each of the lines. A direction in which an error is diffused is a direction of unprocessed pixels nearly in one direction of each of the lines (e.g., a downward direction (a direction from a start line (a first row from the top) to an end line (a bottom row) of the error diffusion processing in lines of pixels of plural rows). A diffusion property of the error is not improved much. Therefore, the image processing apparatus is not sufficient for improving an image quality of an image susceptible to deterioration of an image quality because of error diffusion.